
'''
print("monkey peach")
total=0
total = 1
for i in range(9,0,-1):
    #peach = total +2
    total = (total + 1)*2
    #print("第 %d 天，当日吃桃子数量：%d" % (i,peach))
    print("第 %d 天剩余桃子总数量：%d" % (i,total))
print("桃子总数量 %d" % total)
'''
print('-'*50)
print("yanghui-trangle")
l1 = [1]
l2 = [1,1]
trangle = l1
trangle.append(l2)
print(trangle)
m = 9
for i in range(2,m):
    l = []
    l.append(1)
    for j in range(1,i):
        print(i,j)
        m = trangle[i-1][j-1] + trangle[i-1][j]
        l.append(m)
    l.append(1)
    print(l)
    trangle.append(l)
print(trangle)
m = 7
k = 4
print(trangle[m-1][k-1])
print('-'*50)
print("chongfushuzi、buchongfushuzi")
import random
list1 = []
'''
for i in range(10):
    r = random.randint(1,21)
    list1.append(r)
    '''
len = 20
list1 = [21, 21, 2, 10, 2, 2, 10, 2, 5, 14,3,6,8,10,10,21,5,6,8,10]
repeat_list = {}
unrepeat_list = []
count = [1]*len
for i in range(len):
    if count[i] ==1:
        for j in range(i+1,len):
            if list1[i] == list1[j] and count[i] <= 1:
                count[i] += 1
                count[j] = -1
                repeat_list[list1[i]]=count[i]
            elif list1[i] == list1[j] and count[i] > 1:
                count[i] += 1
                count[j] = -1
                repeat_list[list1[i]]=count[i]
    if count[i] == 1:
        unrepeat_list.append(list1[i])
print(repeat_list)
print(unrepeat_list)
print(count)



